$(function() {
    var cols=6;
	var rows_delete=0;
	var mode="add";
	var m_id=0;
    var url='controls/other_register_model.php';
   
 
	$("#btnSave").click(function(){
		var list_course="";
		var list_bus="";
		
		$.each($("input[name=course]:checked"),function(index){
			list_course+= $(this).val() +",";
		});
		
		$.each($("input[name=bus]:checked"),function(index){
			if ($(this).val() !=0)
				list_bus  = $(this).val() ;
		});
		
		 
			if (list_course!='')
				list_course=list_course.substring(0,list_course.length-1);
			
			
			$.ajax({
				type: 'POST',
				cache: false,
				url: url,
				data: {"m":"update","id":$("#m_id").val(), "course":list_course,"bus":list_bus },
				success: function(data){
				 
					$("#popupSave").modal('hide');
					$("#frmBack").submit();
				}
			});
		 
		
	});
  
	 
  
    
});


